import localStorageService from 'store/localStorageService.js'

const state = {
  nowShop: localStorageService.getNowShop()
}

const getters = {
  nowShop: state => state.nowShop
}

const actions = {
  setNowShop({ commit }, nowShop) {
    commit('setNowShop', nowShop)
  }
}

const mutations = {
  setNowShop(state, nowShop) {
    state.nowShop = nowShop
    localStorageService.setNowShop(nowShop)
  }
}

export default {
  state,
  getters,
  actions,
  mutations
}
